{include file="header" /}
<style type="text/css">
.search-top-box {
    background: #f3f3f3;
    border-bottom: 3px solid #eeeeee;
    padding: 32px 0;
}
</style>
<div class="main">
    <div class="search-top-box">
        <div class="w1200">
            <div class="search_box">
                <div class="search radius6">
                    <form method="get" name="search" action="{:url('cms/index/search')}">
                        <div class="select_box">
                            <div class="select_showbox" style="cursor: pointer;">搜索全部</div>
                            <ul class="select_option">
                                <li><a data-id="">搜索全部</a></li>
                                {volist name="modellist" id="vo"}
                                <li data-id="{$vo.id}" class="{eq name="vo.id" value="$modelid" }selected{/eq}"> <a>{$vo.name}</a></li>
                                {/volist}
                            </ul>
                        </div>
                        <input id="modelid" name="modelid" value="0" type="hidden">
                        <input class="inp_srh" name="keyword" placeholder="请输入搜索关键词" value="{$keyword}">
                        <input class="btn_srh" type="submit" value="搜索">
                    </form>
                </div>
                <div class="search_time color_999 font14">获得约<strong class="color_f00"> {$count} </strong>条结果 （用时{$search_time} 秒）</div>
            </div>
        </div>
    </div>
    <div class="search_result">
        <div class="w1200 clearfix">
            <div class="search_left">
                <div class="search_list">
                    <h5>按时间搜索</h5>
                    <div class="list-group">
                        <a href="?keyword={$keyword}&modelid={$modelid}&time=" class="list-group-item_gr {empty name="time"}active{/empty}">全部时间</a>
                        <a href="?keyword={$keyword}&modelid={$modelid}&time=day" class="list-group-item_gr {eq name="time" value="day"}active{/eq}">一天内</a>
                        <a href="?keyword={$keyword}&modelid={$modelid}&time=week" class="list-group-item_gr {eq name="time" value="week"}active{/eq}">一周内</a>
                        <a href="?keyword={$keyword}&modelid={$modelid}&time=month" class="list-group-item_gr {eq name="time" value="month"}active{/eq}">一月内</a>
                        <a href="?keyword={$keyword}&modelid={$modelid}&time=year" class="list-group-item_gr {eq name="time" value="year"}active{/eq}">一年内</a>
                    </div>
                    <h5>搜索历史</h5>
                    <div class="list-group">
                        {volist name="shistory" id="vo"}
                        <a href="?keyword={$vo}" class="list-group-item_gr" title="{$vo}">{$vo}</a>
                        {/volist}
                    </div>
                </div>
            </div>
            <div class="search_right left-line newsPage">
                <div class="search_bd">
                    <ul class="list">
                        {volist name="list" id="vo" empty="<div class='tc font20 l-h80'>暂时没有数据</div>"}
                        <li class="item clearfix">
                            <a href="{$vo.url}" title="{$vo.title}"><img class="fl" src="https://via.placeholder.com/168x126" alt="{$vo.title}">
                            <div class="time fr"><span class="day">{$vo.updatetime|date="m-d"}</span><span class="year">{$vo.updatetime|date="Y"}</span></div>
                            <h3>{$vo.title|str_ireplace=$keyword,"<font style='color:red'>$keyword</font>",###|raw}</h3>
                            <div class="txt">{$vo.description|str_cut=###,60|str_ireplace=$keyword,"<font style='color:red'>$keyword</font>",###|raw}</div>
                        </a>
                        </li>
                        {/volist}
                    </ul>
                </div>
                <!--S 分页-->
                {$pages|raw}
                <!--E 分页-->
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
$(function() {
    $(".select_showbox").click(function() {
        $(".select_option").show();
        $(this).addClass("active");
    });

    if ($('.select_option li').is('.selected')) {
        $(".select_showbox").html($('.select_option li.selected').html());
        $("#modelid").val($('.select_option li.selected').data('id'));
    }

    $(".select_option li").click(function() {
        $("#modelid").val($(this).data('id'));
        $(".select_showbox").html($(this).html());
        $(".select_option").hide();
        $(".select_showbox").removeClass("active");
    });

    $(".select_option li").hover(function() {
        $(this).addClass("selected");
    }, function() {
        $(this).removeClass("selected");
    });
});
</script>
{include file="footer" /}